/**
 * day4
 */
import java.util.Scanner;
public class Test {
    /**
     *  1.WY22 Fibonacci数列
     *  https://www.nowcoder.com/practice/18ecd0ecf5ef4fe9ba3f17f8d00d2d66?tpId=122&tqId=33668&ru=/exam/oj
     */
    //贪心算法：可以做一个dp表
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();

        int a = 0,b = 1 ,c =1;
        while(n > c){
            a = b;
            b = c;
            c = a + b;
        }

        System.out.println(Math.min(c - n,n -b));
    }

    /**
     *2.NC242 单词搜索
     * https://www.nowcoder.com/practice/987f2981769048abaf6180ed63266bb2?tpId=196&tqId=39583&ru=/exam/oj
     */

        //预处理
        int n ,m,x,y;
        int[] dx = {0,0,-1,1};
        int[] dy = {-1,1,0,0};
        boolean[][] vis;
        char[] word1;
        public boolean exist (String[] board, String word) {
            n = board.length;
            m = board[0].length();
            vis = new boolean[n][m];
            word1 = word.toCharArray();

            for(int i = 0;i < n;i++){
                for(int j = 0;j < m;j++){
                    if(word.charAt(0) == board[i].charAt(j)){
                        if(dps(board,i,j,0)) return true;
                    }
                }
            }
            return false;
        }

        public boolean dps(String[] board,int i,int j,int pos){
            if(pos == word1.length - 1){
                return true;
            }
            vis[i][j] = true;
            for(int k = 0;k < 4;k++){
                x = i + dx[k];y = j + dy[k];
                if(x >= 0 && x < n && y >= 0 && y < m && !vis[x][y] && word1[pos + 1] == board[x].charAt(y)){
                    if(dps(board,x,y,pos+1)) return true;
                }
            }
            vis[i][j] = false;
            return false;
        }

    /**
     * 3.BC140 杨辉三角
     *https://www.nowcoder.com/practice/e671c6a913d448318a49be87850adbcc?tpId=290&tqId=39928&ru=/exam/oj
     * 动态规划：申请 (n + 1) * (n + 1) 大小的二维数组
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] dps = new int[n + 1][n +1];

        dps[1][1] = 1;
        for(int i = 2;i < n + 1;i++){
            for(int j = 1;j <= i;j++){
                dps[i][j] = dps[i-1][j] + dps[i-1][j -1];
            }
        }

        for(int i = 1;i < n + 1;i++){
            for(int j = 1;j <= i;j++){
                StringBuilder str = new StringBuilder();
                int len = Integer.toString(dps[i][j]).length();
                for(int k = 0;k < 5 -len;k++){
                    str.append(" ");
                }
                System.out.print(str.toString() + dps[i][j]);
            }
            System.out.println();
        }

    }
}
